﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Yto.Common.Dependency;
using Yto.Repositories;

namespace com.ytocargo.Core.GeneralDocs
{
    public class GeneralDocStore : IGeneralDocStore, ITransient
    {
        private IBaseRepository<GeneralDoc, string> _baseRepository;

        public GeneralDocStore(IBaseRepository<GeneralDoc, string> baseRepository)
        {
            _baseRepository = baseRepository;
        }

        public Task<bool> BatchInsertAsync(List<GeneralDoc> generalDocs)
        {
            return _baseRepository.BatchInsertAsync(generalDocs);
        }

        public Task<bool> DeleteAllAsync()
        {
            return _baseRepository.DeleteAllAsync();
        }

        public Task DeleteAsync(GeneralDoc generalDoc)
        {
            throw new NotImplementedException();
        }

        public IQueryable<GeneralDoc> GetAll()
        {
            return _baseRepository.GetAll();
        }

        public async Task InsertAsync(GeneralDoc generalDoc)
        {
            await _baseRepository.InsertAsync(generalDoc);
        }
    }
}
